<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AngelScript: Multi-thread support functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
  $(document).ready(function() { init_search(); });
/* @license-end */
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="aslogo_small.png"/></td>
  <td id="projectalign">
   <div id="projectname">AngelScript
   </div>
  </td>
    <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <span id="MSearchSelect"                onmouseover="return searchBox.OnSearchSelectShow()"                onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
          <input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.6 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__api__multithread__functions.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">Multi-thread support functions</div></div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaa5bea65c3f2a224bb1c677515e3bb0e2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__api__multithread__functions.html#gaa5bea65c3f2a224bb1c677515e3bb0e2">asPrepareMultithread</a> (<a class="el" href="classas_i_thread_manager.html">asIThreadManager</a> *externalMgr=0)</td></tr>
<tr class="memdesc:gaa5bea65c3f2a224bb1c677515e3bb0e2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets up the internally shared resources for multithreading.  <br /></td></tr>
<tr class="separator:gaa5bea65c3f2a224bb1c677515e3bb0e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga011355a8978d438cec77b4e1f041cba7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__api__multithread__functions.html#ga011355a8978d438cec77b4e1f041cba7">asUnprepareMultithread</a> ()</td></tr>
<tr class="memdesc:ga011355a8978d438cec77b4e1f041cba7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Frees resources prepared for multithreading.  <br /></td></tr>
<tr class="separator:ga011355a8978d438cec77b4e1f041cba7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga72f005266d6b5258c1dbe10449c78d24"><td class="memItemLeft" align="right" valign="top"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> <a class="el" href="classas_i_thread_manager.html">asIThreadManager</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__api__multithread__functions.html#ga72f005266d6b5258c1dbe10449c78d24">asGetThreadManager</a> ()</td></tr>
<tr class="memdesc:ga72f005266d6b5258c1dbe10449c78d24"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the thread manager used by the application.  <br /></td></tr>
<tr class="separator:ga72f005266d6b5258c1dbe10449c78d24"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga016dbf716a1c761b3f903b92eb8bb580"><td class="memItemLeft" align="right" valign="top"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__api__multithread__functions.html#ga016dbf716a1c761b3f903b92eb8bb580">asAcquireExclusiveLock</a> ()</td></tr>
<tr class="memdesc:ga016dbf716a1c761b3f903b92eb8bb580"><td class="mdescLeft">&#160;</td><td class="mdescRight">Acquire an exclusive lock.  <br /></td></tr>
<tr class="separator:ga016dbf716a1c761b3f903b92eb8bb580"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8a0617637eea3d76e33a52758b2cd49f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__api__multithread__functions.html#ga8a0617637eea3d76e33a52758b2cd49f">asReleaseExclusiveLock</a> ()</td></tr>
<tr class="memdesc:ga8a0617637eea3d76e33a52758b2cd49f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Release an exclusive lock.  <br /></td></tr>
<tr class="separator:ga8a0617637eea3d76e33a52758b2cd49f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa45545a038adcc8c73348cfe9488f32d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__api__multithread__functions.html#gaa45545a038adcc8c73348cfe9488f32d">asAcquireSharedLock</a> ()</td></tr>
<tr class="memdesc:gaa45545a038adcc8c73348cfe9488f32d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Acquire a shared lock.  <br /></td></tr>
<tr class="separator:gaa45545a038adcc8c73348cfe9488f32d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga44f7327c5601e8dbf74768a2f3cc0dc3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__api__multithread__functions.html#ga44f7327c5601e8dbf74768a2f3cc0dc3">asReleaseSharedLock</a> ()</td></tr>
<tr class="memdesc:ga44f7327c5601e8dbf74768a2f3cc0dc3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Release a shared lock.  <br /></td></tr>
<tr class="separator:ga44f7327c5601e8dbf74768a2f3cc0dc3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf0074d581ac2edd06e63e56e4be52c8e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__api__multithread__functions.html#gaf0074d581ac2edd06e63e56e4be52c8e">asAtomicInc</a> (int &amp;value)</td></tr>
<tr class="memdesc:gaf0074d581ac2edd06e63e56e4be52c8e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Increments the value by one and returns the result as a single atomic instruction.  <br /></td></tr>
<tr class="separator:gaf0074d581ac2edd06e63e56e4be52c8e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0565bcb53be170dd85ae27a5b6f2b828"><td class="memItemLeft" align="right" valign="top"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__api__multithread__functions.html#ga0565bcb53be170dd85ae27a5b6f2b828">asAtomicDec</a> (int &amp;value)</td></tr>
<tr class="memdesc:ga0565bcb53be170dd85ae27a5b6f2b828"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decrements the value by one and returns the result as a single atomic instruction.  <br /></td></tr>
<tr class="separator:ga0565bcb53be170dd85ae27a5b6f2b828"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga51079811680d5217046aad2a2b695dc7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__api__multithread__functions.html#ga51079811680d5217046aad2a2b695dc7">asThreadCleanup</a> ()</td></tr>
<tr class="memdesc:ga51079811680d5217046aad2a2b695dc7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Cleans up memory allocated for the current thread.  <br /></td></tr>
<tr class="separator:ga51079811680d5217046aad2a2b695dc7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf192ffe898295aff4a76d8f2ced70034"><td class="memItemLeft" align="right" valign="top"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> <a class="el" href="classas_i_lockable_shared_bool.html">asILockableSharedBool</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__api__multithread__functions.html#gaf192ffe898295aff4a76d8f2ced70034">asCreateLockableSharedBool</a> ()</td></tr>
<tr class="memdesc:gaf192ffe898295aff4a76d8f2ced70034"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a lockable shared boolean.  <br /></td></tr>
<tr class="separator:gaf192ffe898295aff4a76d8f2ced70034"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga016dbf716a1c761b3f903b92eb8bb580" name="ga016dbf716a1c761b3f903b92eb8bb580"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga016dbf716a1c761b3f903b92eb8bb580">&#9670;&#160;</a></span>asAcquireExclusiveLock()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> void asAcquireExclusiveLock </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will block the calling thread until there are no other threads that hold shared or exclusive locks. </p>

</div>
</div>
<a id="gaa45545a038adcc8c73348cfe9488f32d" name="gaa45545a038adcc8c73348cfe9488f32d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa45545a038adcc8c73348cfe9488f32d">&#9670;&#160;</a></span>asAcquireSharedLock()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> void asAcquireSharedLock </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will block the calling thread until there are no other threads that hold exclusive locks. Other threads may hold shared locks. </p>

</div>
</div>
<a id="ga0565bcb53be170dd85ae27a5b6f2b828" name="ga0565bcb53be170dd85ae27a5b6f2b828"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0565bcb53be170dd85ae27a5b6f2b828">&#9670;&#160;</a></span>asAtomicDec()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> int asAtomicDec </td>
          <td>(</td>
          <td class="paramtype">int &amp;&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>A reference to the value that should be decremented </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The decremented value</dd></dl>
<p>This function is especially useful for implementing thread safe reference counters. </p>

</div>
</div>
<a id="gaf0074d581ac2edd06e63e56e4be52c8e" name="gaf0074d581ac2edd06e63e56e4be52c8e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf0074d581ac2edd06e63e56e4be52c8e">&#9670;&#160;</a></span>asAtomicInc()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> int asAtomicInc </td>
          <td>(</td>
          <td class="paramtype">int &amp;&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>A reference to the value that should be incremented </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The incremented value</dd></dl>
<p>This function is especially useful for implementing thread safe reference counters. </p>

</div>
</div>
<a id="gaf192ffe898295aff4a76d8f2ced70034" name="gaf192ffe898295aff4a76d8f2ced70034"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf192ffe898295aff4a76d8f2ced70034">&#9670;&#160;</a></span>asCreateLockableSharedBool()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> <a class="el" href="classas_i_lockable_shared_bool.html">asILockableSharedBool</a> * asCreateLockableSharedBool </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>A new lockable shared boolean.</dd></dl>
<p>The lockable shared boolean will be created with an initial reference count of 1, and the boolean value false.</p>
<p>The object can be used for weak reference flags. </p>

</div>
</div>
<a id="ga72f005266d6b5258c1dbe10449c78d24" name="ga72f005266d6b5258c1dbe10449c78d24"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga72f005266d6b5258c1dbe10449c78d24">&#9670;&#160;</a></span>asGetThreadManager()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> <a class="el" href="classas_i_thread_manager.html">asIThreadManager</a> * asGetThreadManager </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>The thread manager prepared with <a class="el" href="group__api__multithread__functions.html#gaa5bea65c3f2a224bb1c677515e3bb0e2">asPrepareMultithread()</a> </dd></dl>

</div>
</div>
<a id="gaa5bea65c3f2a224bb1c677515e3bb0e2" name="gaa5bea65c3f2a224bb1c677515e3bb0e2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa5bea65c3f2a224bb1c677515e3bb0e2">&#9670;&#160;</a></span>asPrepareMultithread()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> int asPrepareMultithread </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classas_i_thread_manager.html">asIThreadManager</a> *&#160;</td>
          <td class="paramname"><em>externalMgr</em> = <code>0</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">externalMgr</td><td>Pre-existent thread manager (optional) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A negative value on error </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">asINVALID_ARG</td><td>externalMgr informed even though local manager already exists</td></tr>
  </table>
  </dd>
</dl>
<p>Call this function from the main thread to set up shared resources for multithreading if engines are to be created in multiple threads.</p>
<p>If multiple modules (dlls) are used it may be necessary to call this with the thread manager retrieved from <a class="el" href="group__api__multithread__functions.html#ga72f005266d6b5258c1dbe10449c78d24">asGetThreadManager()</a> in the main module in order for all modules to share the same thread manager.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="doc_adv_multithread.html">Multithreading</a> </dd></dl>

</div>
</div>
<a id="ga8a0617637eea3d76e33a52758b2cd49f" name="ga8a0617637eea3d76e33a52758b2cd49f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8a0617637eea3d76e33a52758b2cd49f">&#9670;&#160;</a></span>asReleaseExclusiveLock()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> void asReleaseExclusiveLock </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Releases the previously acquired exclusive lock. </p>

</div>
</div>
<a id="ga44f7327c5601e8dbf74768a2f3cc0dc3" name="ga44f7327c5601e8dbf74768a2f3cc0dc3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga44f7327c5601e8dbf74768a2f3cc0dc3">&#9670;&#160;</a></span>asReleaseSharedLock()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> void asReleaseSharedLock </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Releases the previously acquired shared lock. </p>

</div>
</div>
<a id="ga51079811680d5217046aad2a2b695dc7" name="ga51079811680d5217046aad2a2b695dc7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga51079811680d5217046aad2a2b695dc7">&#9670;&#160;</a></span>asThreadCleanup()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> int asThreadCleanup </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>A negative value on error. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">asCONTEXT_ACTIVE</td><td>A context is still active.</td></tr>
  </table>
  </dd>
</dl>
<p>Call this function before terminating a thread that has accessed the engine to clean up memory allocated for that thread.</p>
<p>It's not necessary to call this if only a single thread accesses the engine. </p>

</div>
</div>
<a id="ga011355a8978d438cec77b4e1f041cba7" name="ga011355a8978d438cec77b4e1f041cba7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga011355a8978d438cec77b4e1f041cba7">&#9670;&#160;</a></span>asUnprepareMultithread()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> void asUnprepareMultithread </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>If <a class="el" href="group__api__multithread__functions.html#gaa5bea65c3f2a224bb1c677515e3bb0e2">asPrepareMultithread()</a> has been called, then this function should be called after the last engine has been released to free the resources prepared for multithreading. </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Sun May 21 2023 10:12:40 for AngelScript by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6 </li>
  </ul>
</div>
</body>
</html>
